"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var operators_1 = require("rxjs/operators");
var core_1 = require("./core");
var path_1 = require("path");
var index_1 = require("../../functions/index");
var install_1 = require("../../../public/install");
var web_1 = require("../../../public/web");
function main(option) {
    return index_1.fileExist(path_1.join(__dirname, 'data', 'install.loc')).pipe(operators_1.switchMap(function (exist) {
        if (exist) {
            return core_1.bootstrap(option.port, option.host, option.app, web_1.createHtmlEngine(), {
                cors: true
            });
        }
        else {
            return core_1.bootstrap(option.port, option.host, option.install, install_1.createHtmlEngine(), {
                cors: false
            });
        }
    }));
}
exports.main = main;
